// 出车单记录 (issue: 出单)
<template>
  <div class="oilEnter-container">
    <van-nav-bar
      class="app-nav-bar"
      title="出车单记录"
      left-arrow
      @click-left="$router.back()"
    />
    <div class="cell-box">
      <van-cell color="#7232dd" is-link title="出车账单填写" @click="toPath('addForm')"/>
      <van-cell is-link title="历史出单查询" @click="toPath('history')"/>
      <!-- <van-cell is-link title="查看盈利情况" @click="toPath('addForm')"/> -->
    </div>
    <!-- <van-uploader
      :max-size="10000000"
      :after-read="uploadImg"
      :before-read="beforeRead"
      :max-count="1"
      v-model="fileList"
      multiple
    /> -->
  </div>
</template>

<script>
// import { addLeave, getLeave } from '@/api/leave'
export default {
  name: 'issueIndex',
  components: {},
  props: {},
  data () {
    return {
      fileList: [], // 图片
      imgurl: '', // 图片路径
      oneurl: '', // 传给后台的图片类型
      imgs: '' // 截图
    }
  },
  computed: {},
  watch: {},
  created () {},
  mounted () {},
  methods: {
    uploadImg (file) {
      console.log(file) // 控制台可以看见图片信息
      const data = new FormData()
      data.append('source', file.file)
      // param.append('token', localStorage.getItem('token'))
      this.$upload.post('/json', data).then(res => { // upload/?key=77e4eb461b46752695bb6f2605547f28&format=
        console.log('图床', res)
        this.oneurl = ''
      })
    },
    beforeRead (file) {
      return true
    },
    beforeDelete (file) {
      return false
    },
    toPath (v) {
      this.$router.push(`/issue/${v}`)
    }
  }
}
</script>

<style scoped lang="scss">
.cell-box {
  padding: 0 10px;
}
.van-cell {
  border-radius: 10px;
  margin: 16px 0;
  // background-color: rgba(102, 137, 253, 0.9);
  height: 45px;
}
.tab_field {
  padding: 0 10px;
}
// .van-button--normal {
//     padding: 0 0.4rem;
//     font-size: 0.37333rem;
//     border-radius: 10px;
// }
.field-btn {
  border-radius: 10px;
  background-color: rgba(25, 137, 250, 0.7);
}
</style>
